<template>
    <div class="header">
      <div class="header-left">
        <span class="iconfont back-icon">&#xe604;</span>
      </div>

      <div class="header-input">
        <span class="iconfont search-icon">&#xe633;</span>
        <span>输入城市/景点/游玩主题</span>
      </div>
      <router-link to="/city">
        <div class="header-right">
          <span>{{city}}</span>
          <span class="iconfont arrow-icon">&#xe6aa;</span>
        </div>
    </router-link>
    </div>
</template>

<script>
import { mapState } from 'vuex'
export default{
  name: 'indexHeader',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped>
@import '~@styles/varibles.styl'
.header
  background: $bgColor
  line-height: $headerHeight
  color: #FFFFFF
  display: flex

  .header-left
    float: left
    width: 0.64rem
    text-align: center
    .back-icon
      font-size: .4rem

  .header-input
    flex: 1
    margin-top: 0.15rem
    height: 0.56rem
    line-height: .56rem
    background: #fff
    border-radius: .1rem
    color: #ddd
    font-size: .25rem
    .search-icon
      margin-left: .15rem
      font-size: .35rem

  .header-right
    float: right
    mix-width: 1.0rem
    padding 0 .1rem
    text-align: center
    color: #fff
    .arrow-icon
      margin-left: -0.1rem
</style>
